<html>
<head>
	<title>Excersise 7</title>
	<link href="styles/js-console.css" rel="stylesheet" />
</head>
<body>
	<div id="js-console"></div>
	<script src="scripts/js-console.js"></script>
	<script>

	var digits = new Array(4,3,41,3,12,21);
	var counter=1;
	var index=-1;
	jsConsole.write("the given array is: ");	
	for (i=0;i<digits.length;i++)
	{
		jsConsole.write(digits[i] + ", ");	
	}
	
	function FirstBigger(array)
	{
		do
		{
			if((array[counter] > array[counter-1])&&(array[counter]>array[counter+1]))
			{
				index = counter;
			}	
			counter++;
		} while((index==-1)&&(counter<=(array.length-2)));
		
	}	
	jsConsole.writeLine(FirstBigger(digits));
	jsConsole.write("index of first nuber bigger than neigbours is: " + index);
	</script>
</body>
</html>
